/**
 * 连接redis
 */
'use strict';

import * as redis from 'koa-redis';
import config from './config';

var redisConnection = config.get('redis');
const redisClient = redis(eval("redisConnection." + config.get('env'))).client;

redisClient.on('connect', ()=>{
    console.log('Radis 服务连接完成');
})

redisClient.on('error', ()=>{
    console.error(new Date().toLocaleTimeString() + ' Radis 服务未启动');
})

export default redisClient;